package utils

import (
	"log"
	"os"
)

// InitLog 初始化日志配置
func InitLog() {
	logFile, err := os.OpenFile("/var/log/volux.log", os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0666)
	if err != nil {
		log.Fatalf("Failed to open log file: %v", err)
	}
	log.SetOutput(logFile)
	log.SetFlags(log.LstdFlags | log.Lshortfile)
}

// LogError 记录错误日志
func LogError(msg string) {
	log.Println("ERROR:", msg)
}
